import React, { Component, PropTypes } from 'react'
import { Icon } from 'antd-mobile'

export default class InputAddOn extends Component {
  render() {
    const { addonBefore, addonAfter } = this.props
    return (
      <div className="cm-input-add-on InputAddOn">
        {
          addonBefore
          ? <span className="InputAddOn-item">{addonBefore}</span>
          : null
        }
        <input className="InputAddOn-field" />
        {
          addonAfter
          ? <button className="InputAddOn-item">{addonAfter}</button>
          : null
        }
      </div>
    )
  }
}

InputAddOn.propTypes = {
  addonBefore: PropTypes.node,
  addonAfter: PropTypes.node,
}